<?php
declare(strict_types=1);

class c_excel extends Control
{
    //写入文件
    public function index()
    {
        $data = [
            ['id'=>1,'name'=>'sen1'],
            ['id'=>2,'name'=>'sen2'],
            ['id'=>3,'name'=>'sen3']
        ];
        $title = [
            ['A','id','编号',15],
            ['B','name','姓名',20]
        ];
        $name = 'test2';
        $excel = new module_excel();
        $excel->write_data($title,$data,$name);
    }

    //读取文件
    public function uploads_data()
    {
        $path = './public/excel/2025/2025-01-06/test2.xlsx';
        $excel = new module_excel();
        $data = $excel->read_data($path);
        echo '<pre>';print_r($data);die;
    }
    //多工作表
    public function sheets()
    {
        $excel = new module_excel();
        $excel->sheets();
    }
}
